package subject_observer;

import java.util.Iterator;
import java.util.LinkedList;

public abstract class AbstractSubject 
{
	public void attach(IObserver obsever)
	{
		itsIObservers.add(obsever);
	}
	public void detach(IObserver obsever)
	{
		itsIObservers.remove(obsever);
	}
	public void notifyObservers()
	{
		for(Iterator<IObserver> it = itsIObservers.iterator();
			it.hasNext();)
		{
			IObserver observer = it.next();
			observer.update();
		}
	}
	
	protected LinkedList<IObserver> itsIObservers = new LinkedList<IObserver>();
}
